<?php
$path_root = $_SERVER['DOCUMENT_ROOT'];
require_once($path_root."/AppSaleOnline/model/invoice.php");

$invoice_id = $_POST['invoice_id'];
$res = array(
    'error' => false,
    'msg'   => '',
    'invoice_id'     => $invoice_id
);

$obj_invoice = new Invoice();

// xoa mot hoa don ra khoi he thong
if(!$obj_invoice->del_invoice_with_id($invoice_id)) { 
    $res = array(
        'error' => true,
        'msg' => 'An error occurred. Please try again!'
    );
}

echo json_encode($res);